#include "mainwindow.h"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    _myOpenGLWidget = new MyOpenGLWidget;
    this->setCentralWidget(_myOpenGLWidget);
    //设置窗口大小
    this->setGeometry(0,0,800,600);
    //创建定时器，定时刷新QOpenGLWidget
    _timer = new QTimer(this);
    connect(_timer, &QTimer::timeout, this, [this]{
        _myOpenGLWidget->update();
    });
    _timer->start(33);
}

MainWindow::~MainWindow() {
    if(_myOpenGLWidget)delete _myOpenGLWidget;
}
